home *** CD-ROM | disk | FTP | other *** search
-
- MSGGET(2) UNIX Programmer's Manual MSGGET(2)
-
- NNAAMMEE
- mmssggggeett - get message queue
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
- ##iinncclluuddee <<ssyyss//iippcc..hh>>
- ##iinncclluuddee <<ssyyss//mmssgg..hh>>
-
- _i_n_t
- mmssggggeett(_k_e_y___t _k_e_y, _i_n_t _m_s_g_f_l_g)
-
- DDEESSCCRRIIPPTTIIOONN
- mmssggggeett() returns the message queue identifier associated with _k_e_y. A mes-
- sage queue identifier is a unique integer greater than zero.
-
- A message queue is created if either _k_e_y is equal to IPC_PRIVATE, or _k_e_y
- does not have a message queue identifier associated with it, and the
- IPC_CREAT bit is set in _m_s_g_f_l_g_.
-
- If a new message queue is created, the data structure associated with it
- (the _m_s_q_i_d___d_s structure, see msgctl(2)) is initialized as follows:
-
- ++oo _m_s_g___p_e_r_m_._c_u_i_d and _m_s_g___p_e_r_m_._u_i_d are set to the effective uid of the
- calling process.
-
- ++oo _m_s_g___p_e_r_m_._g_i_d and _m_s_g___p_e_r_m_._c_g_i_d are set to the effective gid of the
- calling process.
-
- ++oo _m_s_g___p_e_r_m_._m_o_d_e is set to the lower 9 bits of _m_s_g_f_l_g.
-
- ++oo _m_s_g___c_b_y_t_e_s, _m_s_g___q_n_u_m, _m_s_g___l_s_p_i_d, _m_s_g___l_r_p_i_d, _m_s_g___r_t_i_m_e, and _m_s_g___s_t_i_m_e
- are set to 0
-
- ++oo _m_s_g___q_b_y_t_e_s is set to the system wide maximum value for the number of
- bytes in a queue (MSGMNB).
-
- ++oo _m_s_g___c_t_i_m_e is set to the current time.
-
- RREETTUURRNN VVAALLUUEESS
- Upon successful completion a positive message queue identifier is re-
- turned. Otherwise, -1 is returned and the global variable _e_r_r_n_o is set
- to indicate the error.
-
- EERRRROORRSS
- [EACESS] A message queue is already associated with _k_e_y and the
- caller has no permission to access it.
-
- [EEXIST] Both IPC_CREAT and IPC_EXCL are set in _m_s_g_f_l_g, and a mes-
- sage queue is already associated with _k_e_y.
-
- [ENOSPC] A new message queue could not be created because the system
- limit for the number of message queues has been reached.
-
- [ENOENT] IPC_CREAT was not set in _m_s_g_f_l_g and no message queue asso-
- ciated with _k_e_y was found.
-
- SSEEEE AALLSSOO
- msgctl(2), msgrcv(2), msgsnd(2)
-
- HHIISSTTOORRYY
- Message queues appeared in the first release of AT&T Unix System V.
-
- NetBSD August 17, 1995 1
-